/*
 * @Author: GYY
 * @Date: 2024-02-17 15:13:20
 * @LastEditTime: 2024-02-17 15:13:20
 * @LastEditors: GYY
 * @Description: 
 */

import request from '/@/utils/request';


/**
 *创建根证书
 * {"info": {"country": "中国", "province": "陕西省", "city": "延安市", "area": "黄陵县", "street": "桥山街道办事处轩辕大道1号", "village": "秦创原轩辕科技创新中心A120室", "organize": "中电黄陵数字产业发展有限公司","unit": "安全技术团队"}}
 * @param query
 */
export function addRootca(query: any) {
	return request({
		url: '/cert/rootca',
		method: 'POST',
		data: query,
	});
}

/**
 * 获取根证书 列表 list
 * page  size
 */
export function getRootcaList(query: any) {
	return request({
		url: '/cert/rootca',
		method: 'get',
		params: query,
	});
}
/**
 * 下载根证书
 * numb
 */
export function downloadRootca(query: any) {
	return request({
		url: '/cert/rootca',
		method: 'get',
		params: query,
		responseType:'blob'
	});
}
/**
 * 删除根证书
 * numb
 */
export function deleteRootca(query: any) {
	return request({
		url: `/cert/rootca/${query}`,
		method: 'DELETE',
	});
}

/*----------------中级证书------------------------------------*/
/**
 *创建根证书
 * {"info": {"country": "中国", "province": "陕西省", "city": "延安市", "area": "黄陵县", "street": "桥山街道办事处轩辕大道1号", "village": "秦创原轩辕科技创新中心A120室", "organize": "中电黄陵数字产业发展有限公司","unit": "安全技术团队"}}
 * @param query
 */
export function addMiddle(query: any) {
	return request({
		url: '/cert/middle',
		method: 'POST',
		data: query,
	});
}

/**
 * 获取根证书 列表 list
 * page  size
 */
export function getMiddleList(query: any) {
	return request({
		url: '/cert/middle',
		method: 'get',
		params: query,
	});
}
/**
 * 下载根证书
 * numb
 */
export function downloadMiddle(query: any) {
	return request({
		url: '/cert/middle',
		method: 'get',
		params: query,
		responseType:'blob'
	});
}
/**
 * 删除根证书
 * numb
 */
export function deleteMiddle(query: any) {
	return request({
		url: `/cert/middle/${query}`,
		method: 'DELETE',
	});
}


/*----------------服务证书------------------------------------*/
/**
 *创建服务证书证书
 * {"info": {"country": "中国", "province": "陕西省", "city": "延安市", "area": "黄陵县", "street": "桥山街道办事处轩辕大道1号", "village": "秦创原轩辕科技创新中心A120室", "organize": "中电黄陵数字产业发展有限公司","unit": "安全技术团队"}}
 * @param query
 */
export function addServer(query: any) {
	return request({
		url: '/cert/server',
		method: 'POST',
		data: query,
	});
}

/**
 * 获取根证书 列表 list
 * page  size
 */
export function getServerList(query: any) {
	return request({
		url: '/cert/server',
		method: 'get',
		params: query,
	});
}
/**
 * 下载根证书
 * numb
 */
export function downloadServer(query: any) {
	return request({
		url: '/cert/server',
		method: 'get',
		params: query,
		responseType:'blob'
	});
}
/**
 * 删除根证书
 * numb
 */
export function deleteServer(query: any) {
	return request({
		url: `/cert/server/${query}`,
		method: 'DELETE',
	});
}

/*----------------用户证书------------------------------------*/
/**
 *创建服务证书证书
 * {"info": {"country": "中国", "province": "陕西省", "city": "延安市", "area": "黄陵县", "street": "桥山街道办事处轩辕大道1号", "village": "秦创原轩辕科技创新中心A120室", "organize": "中电黄陵数字产业发展有限公司","unit": "安全技术团队"}}
 * @param query
 */
export function addClient(query: any) {
	return request({
		url: '/cert/client',
		method: 'POST',
		data: query,
	});
}

/**
 * 获取根证书 列表 list
 * page  size
 */
export function getClientList(query: any) {
	return request({
		url: '/cert/client',
		method: 'get',
		params: query,
	});
}
/**
 * 下载根证书
 * numb
 */
export function downloadClient(query: any) {
	return request({
		url: '/cert/client',
		method: 'get',
		params: query,
		responseType:'blob'
	});
}
/**
 * 删除根证书
 * numb
 */
export function deleteClient(query: any) {
	return request({
		url: `/cert/client/${query}`,
		method: 'DELETE',
	});
}


/*----------------吊销------------------------------------*/
/**
 *创建服务证书证书
 * {"info": {"country": "中国", "province": "陕西省", "city": "延安市", "area": "黄陵县", "street": "桥山街道办事处轩辕大道1号", "village": "秦创原轩辕科技创新中心A120室", "organize": "中电黄陵数字产业发展有限公司","unit": "安全技术团队"}}
 * @param query
 */
export function addRevoke(query: any) {
	return request({
		url: '/cert/revoke',
		method: 'POST',
		data: query,
	});
}

/**
 * 获取根证书 列表 list
 * page  size
 */
export function getRevokeList(query: any) {
	return request({
		url: '/cert/revoke',
		method: 'get',
		params: query,
	});
}
/**
 * 下载根证书
 * numb
 */
export function downloadRevoke(query: any) {
	return request({
		url: '/cert/revoke',
		method: 'get',
		params: query,
		responseType:'blob'
	});
}
/**
 * 删除根证书
 * numb
 */
export function deleteRevoke(query: any) {
	return request({
		url: `/cert/revoke/${query}`,
		method: 'DELETE',
	});
}

